import { RouteRecordRaw } from 'vue-router'

const customerRoutes: Array<RouteRecordRaw> = [
  {
    path: '/customer',
    redirect: '/customer/customer',
    name: 'Customer',
    meta: { title: '客户管理', icon: 'customer' },
    children: [
      {
        path: 'customer',
        component: () => import('../views/customer/list/index.vue'),
        name: 'CustomerList',
        meta: { title: '客户列表', icon: 'customer-list' },
      },
      {
        path: 'view/:id',
        redirect: to => `/customer/detail/${to.params.id}`,
        name: 'CustomerView',
        meta: { title: '客户详情（已废弃，请使用客户详情）', icon: 'customer-view' },
      },
      {
        path: 'detail/:id',
        component: () => import('../views/customer/detail/index.vue'),
        name: 'CustomerDetail',
        meta: { title: '客户详情', icon: 'customer-view' },
        props: true,
      },
      {
        path: 'edit/:id',
        component: () => import('../views/customer/edit/index.vue'),
        name: 'CustomerEdit',
        meta: { title: '编辑客户', icon: 'customer-edit' },
        props: true,
      },
      {
        path: 'add',
        component: () => import('../views/customer/add/index.vue'),
        name: 'CustomerAdd',
        meta: { title: '新增客户', icon: 'customer-add' },
      },
      {
        path: 'contact',
        component: () => import('../views/customer/contactlist/index.vue'),
        name: 'CustomerContact',
        meta: { title: '客户联系人', icon: 'customer-list' },
      },
      {
        path: 'chance',
        component: () => import('../views/customer/chance/index.vue'),
        name: 'CustomerChance',
        meta: { title: '客户机会', icon: 'customer-list' },
      },
      {
        path: 'trace',
        component: () => import('../views/customer/trace/index.vue'),
        name: 'CustomerTrace',
        meta: { title: '客户轨迹', icon: 'customer-list' },
      },
      {
        path: 'index/trash',
        component: () => import('../views/customer/discard/index.vue'),
        name: 'CustomerDiscard',
        meta: { title: '废弃客户', icon: 'customer-list' },
      },
      {
        path: 'account',
        component: () => import('../views/customer/account/AccountList.vue'),
        name: 'CustomerAccount',
        meta: { title: '客户账号', icon: 'customer-list' },
      },
      {
        path: 'account/list',
        component: () => import('../views/customer/account/AccountList.vue'),
        name: 'AccountList',
        meta: { title: '账号列表', icon: 'customer-list' },
      },
      {
        path: 'membership',
        component: () => import('../views/customer/membership/MembershipList.vue'),
        name: 'CustomerMembership',
        meta: { title: '会员管理', icon: 'customer-list' },
      },
      {
        path: 'membership/list',
        component: () => import('../views/customer/membership/MembershipList.vue'),
        name: 'MembershipList',
        meta: { title: '会员列表', icon: 'customer-list' },
      },
    ],
  },
]

export default customerRoutes
